<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>确认订单</title>
    <link rel="stylesheet" type="text/css" href="../../css/all.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/pages-item.css"/>
</head>
<script type="text/javascript" src="../../js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="../../js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="../../js/plugins/jquery.jqzoom/jquery.jqzoom.js"></script>
<script type="text/javascript" src="../../js/plugins/jquery.jqzoom/zoom.js"></script>
<script>
    // $(function () {
    //
    //     /*获取username*/
    //     $.get("/portal/username.do", function (username) {
    //         console.log(username);
    //         /*通过username获取user对象*/
    //         $.post("/user/queryByUsername.do", {"username": username},
    //             function (user) {
    //                 console.log(user.username);
    //                 console.log(user.id);
    //             });
    //     });
    //
    //     /*获取项目的回报内容信息*/
    //     // $.get("/projects/queryAll.do");
    // });
</script>
<body>
<!-- 头部栏位 -->
<!--页面顶部-->
<div id="nav-bottom">
    <h1 th:text="${id}"></h1>
    <!--顶部-->
    <div class="nav-top">
        <div class="top">
            <div class="py-container">
                <div class="shortcut">
                    <ul class="fr">
                        <li class="f-item">
                            <a href="../../login.html" target="_blank">登录/注册</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <!--头部-->
        <div class="header">
            <div class="py-container">
                <div class="yui3-g Logo">
                    <div class="yui3-u Left logoArea">
                        <a class="logo-bd" href="index.html" target="_blank">
                            <img src="../../img/logo.jpg">
                        </a>
                    </div>
                    <div class="yui3-u Rit searchArea">
                        <div class="search">
<!--                            <form action="" class="sui-form form-inline">-->
                                <!--searchAutoComplete-->
                                <div class="input-append">
                                    <input type="text" id="autocomplete" class="input-error input-xxlarge"/>
                                    <button class="sui-btn btn-xlarge btn-danger" type="button">搜索</button>
                                </div>
<!--                            </form>-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="py-container">
    <!--表单-->
    <div class="clearfix">
        <div class="sui-steps steps-auto">
            <div class="wrap">
                <div class="current">
                    <label><span class="round">1</span><span>第一步 确认订单</span></label><i class="triangle-right-bg"></i><i
                        class="triangle-right"></i>
                </div>
            </div>
            <div class="wrap">
                <div class="todo">
                    <label><span class="round">2</span><span>第二步 付款</span></label><i class="triangle-right-bg"></i><i
                        class="triangle-right"></i>
                </div>
            </div>
            <div class="wrap">
                <div class="todo">
                    <label><span class="round">3</span><span>第三步 完成</span></label>
                </div>
            </div>
        </div>
        <!--第一次提交 这样写不知道对不对-->
        <form id="addressHaved" method="post" action="/order/addOrder.do" >
<!--            <input type="hidden" th:value="${user_id}" id="user_id">-->
        <div class="like">
            <h4 class="kt">确认回报内容</h4>
            <div class="intro-detail">
                <ul class="goods-intro unstyled">
                    <li>发起人：<span th:text="${project.userId}"></span></li>
                    <li>回报内容：<span th:text="${reward.content}"></span></li>
                    <li>单 价：<span th:text="${reward.money}"></span></li>
                    <li>运 费：<span th:text="${reward.fare}" th:if="${reward.id} eq ${project.rewardId}"></span></li>
                </ul>
            </div>
        </div>
        <div class="like">
            <h4 class="kt">收货地址</h4>
            <div class="intro-detail">
                <div class="goods-intro unstyled">
					<span th:each="addresses:${addressList}">
						<input type="radio" name="address" onchange="addr()">
						<span th:text="${addresses.addrName}"></span>
						<span th:text="${addresses.addrPhone}"></span>
						<span th:text="${addresses.address}"></span><br><br>
					</span>
<!--                    <input type="radio" value="addr0" name="address" onchange="addr()"-->
<!--                           checked><label>添加新地址</label><br><br>-->
                    <!--第二次提交-->
<!--                    <form id="newAddress" hidden="hidden" method="post" action="/address/addAddress">-->
<!--                        <label>收货人</label>-->
<!--                        <input type="text" value="" name="addrName"><br><br>-->
<!--                        <label>电话号</label>-->
<!--                        <input type="text" value="" name="addrPhone"><br><br>-->
<!--                        <label>地址</label>-->
<!--                        <input type="text" value="" name="newAddr"><br><br>-->
<!--                        <input type="submit" value="保存">-->
<!--                    </form>-->
                </div>
            </div>
        </div>
        <div class="like">
            <h4 class="kt">发票信息</h4>
            <div class="intro-detail">
                <!--发票提交-->
<!--                <form class="goods-intro unstyled" id="invoiceSubmit" method="post" action="/projects/projectQuery.do">-->
                    <input type="radio" value="0" name="invoice" onclick="invoiceUser()"
                           checked><label>不需要发票</label><br><br>
                    <input type="radio" value="1" name="invoice" onclick="invoiceUser()"><label>需要发票</label><br><br>
                    <div id="invoice-user" hidden="hidden">
                        <label>发票抬头</label>
                        <input type="text" value="" name="invoiceHead">
                    </div>
<!--                </form>-->
            </div>
        </div>
        <div class="summary-wrap">
            <div class="fl fix-width">
                <em class="t-gray">选择数量</em>
            </div>
        </div>
            <div class="fl title">
                <div class="control-group">
                    <!--数量提交-->
                    <div class="controls" id="amountSubmit" method="post" action="/projects/projectQuery.do">
                        <!--input提交-->
                        <input autocomplete="off" type="text" value="1" minnum="1" class="itxt" name="amount"
                               id="amount"/>
                        <a href="javascript:void(0);" class="increment plus" onclick="plus()">+</a>
                        <a href="javascript:void(0);" class="increment mins" onclick="mins()">-</a>
                    </div>
                </div>
            </div>
            <div class="fl">
                <ul class="btn-choose unstyled">
                    <li>
                        <!--type="submit"-->
                        <button class="sui-btn  btn-danger addshopcar" type="submit">下一步</button>
                    </li>
                </ul>
            </div>
        </form>
        <div class="intro-detail">
            <ul class="goods-intro unstyled">
                <h4>提示</h4>
                <li>1.众筹并非商品交易，存在一一定风险。支持者根据自己的判断选择、支持众筹项目，与发起人共同实现梦粗并获得发起人承诺的回报。</li>
                <li>2.众筹平台仅提供平台网络空间及技术支持等中介服务，众筹仅存在于发起人和支持者之间，使用众筹平台产生的法律后果由发起人与支持者自行承担。</li>
                <li>3.本项目必须在截止日期之前达到目标金额才算成功。否则已经支持的订单将取消。订单取消或募集失败的。您支持的金额将原支付路径退回。</li>
                <li>4..请在支持项目后15分钟内付款，否则您的支持请求会被自动关闭。</li>
                <li>5.众筹成功后由发起人统一 进行发货，售后服务由发起人统一 提供;如果发生发起人无法发放回报、延迟发放回报。不提供回报后续服务等情况，您需要直接和发起人协商解决。</li>
                <h5>如您不同宽上述风险提示内容，您有权选择不支持:一旦选择支持，视为您已确认并同意以上提示内容。</h5>
            </ul>
        </div>
    </div>
</div>

<!-- 底部栏位 -->
<!--页面底部-->
<div class="clearfix footer">
    <div class="py-container">
        <div class="footlink">
            <div class="Mod-copyright">
                <ul class="helpLink">
                    <li>关于我们
                        <span class="space"></span>
                    </li>
                    <li>联系我们
                        <span class="space"></span>
                    </li>
                    <li>个人中心
                        <span class="space"></span>
                    </li>
                    <li>我要发起
                        <span class="space"></span>
                    </li>
                    <li>我要支持
                        <span class="space"></span>
                    </li>
                    <li>收货地址
                        <span class="space"></span>
                    </li>
                    <li>实名认证
                        <span class="space"></span>
                    </li>
                    <li>基本信息
                        <span class="space"></span>
                    </li>
                    <li>发起协议</li>
                </ul>
                <p>地址：xxx 邮编：xxx 电话：xxx-xxx-xxxx 传真：xxx-xxxxxxxx</p>
            </div>
        </div>
    </div>
</div>


<script>
    <!--	第一次提交-->
    function userId() {
        document.getElementById("addressHaved").submit();
    }

    function addr() {
        var _dafult = "addr0";
        var ad = document.getElementsByName("address");
        for (var i = 0; i < ad.length; i++) {
            ad[i].onchange = function () {
                if (this.value != _dafult) {
                    document.getElementById("newAddress").setAttribute("hidden", "hidden");
                } else {
                    document.getElementById("newAddress").removeAttribute("hidden");
                }
            }
        }
    }

    function invoiceUser() {
        var val = document.getElementsByName("invoice");
        if (val[0].checked) {
            document.getElementById("invoice-user").setAttribute("hidden", "hidden");
        } else {
            document.getElementById("invoice-user").removeAttribute("hidden");
        }
    }
</script>
<script>
    function plus() {
        let amount = document.getElementById("amount").getAttribute("value");
        document.getElementById("amount").setAttribute("value", (parseInt(amount) + 1).toString());
    }

    function mins() {
        let num = document.getElementById("amount").getAttribute("value");
        let amount = parseInt(num);
        if (amount > 1) {
            document.getElementById("amount").setAttribute("value", (amount - 1).toString());
        }
    }
</script>
</body>

</html>